import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/home/index.vue'
import TabBar from '../components/TabBar.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    components:{
      default:Home,
      footer:TabBar
    } 
  },
  {
    path: '/cart',
    name: 'cart',
   
    components:{
      default:() => import('../views/cart/index.vue'),
         footer:TabBar
    } 
  },

  {
    path: '/detail/:id',
    name: 'detail',
   
    component:
     () => import('../views/detail/index.vue'),
       
    
  },
  {
    path: '/login',
    name: 'login',
   
    component:
     () => import('../views/login/index.vue'),
       
    
  },
  {
    path: '/register',
    name: 'register',
   
    component: () => import('../views/register/index.vue'),
       
    
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
